#pragma once
#include <string>
#include <exception>
namespace CSApi
{
class CSException : public std::exception
{
   private:
		std::string m_message;
   public:
		CSException() throw() {}
		CSException(const std::string &message) throw() { m_message = message; }

        virtual ~CSException() throw() {};
		virtual const char* what() const throw() { return m_message.c_str();}
};

#define DECLARE_EXCEPTION(x) class x : public CSException { public: x() throw() {} x(const std::string &m) throw() : CSException(m){} }

DECLARE_EXCEPTION(CSException_WrongArgument);
DECLARE_EXCEPTION(CSException_AuthenticationFailed);
DECLARE_EXCEPTION(CSException_InvalidPath);
DECLARE_EXCEPTION(CSException_StorageOffline);
DECLARE_EXCEPTION(CSException_InvalidType);
DECLARE_EXCEPTION(CSException_InvalidOperation);
DECLARE_EXCEPTION(CSException_FileNotExits);
DECLARE_EXCEPTION(CSException_FolderNotExits);
DECLARE_EXCEPTION(CSException_FileExits);
DECLARE_EXCEPTION(CSException_FolderExits);
DECLARE_EXCEPTION(CSException_OperationFailed);
DECLARE_EXCEPTION(CSException_Unknown);
};